package com.example.keeppwd2;

import android.annotation.TargetApi;
import android.content.Context;
import android.hardware.fingerprint.FingerprintManager;

public class FingerprintHelper {
	@TargetApi(23)
	public static FingerprintManager getFingerprintManager(Context context) {
		FingerprintManager fingerprintManager = null;
		try {
			fingerprintManager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
		} catch (Throwable e) {
			e.printStackTrace();
		}
		return fingerprintManager;
	}

	@TargetApi(23)
	public static boolean IsSupportFingerprint(Context context) {
		try {
			FingerprintManager fm=getFingerprintManager(context);
			if(fm.isHardwareDetected()){
				return true;
			}
		} catch (Throwable e) {
			e.printStackTrace();
		}
		return false;
	}
}
